/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package cifar10;

import de.lmu.ifi.dbs.jfeaturelib.LibProperties;
import de.lmu.ifi.dbs.jfeaturelib.features.FeatureDescriptor;
import de.lmu.ifi.dbs.jfeaturelib.features.Histogram;
import ij.process.ColorProcessor;
import java.awt.Color;
import java.awt.image.BufferedImage;
import java.io.File;
import java.util.Arrays;
import javax.imageio.ImageIO;

/**
 *
 * @author mwh
 */
public class test {
    
    public static void main(String[] args)throws Exception{
        
        Histogram fd = new Histogram();
        LibProperties lp = new LibProperties();
        lp.setProperty(LibProperties.HISTOGRAMS_TYPE, Histogram.TYPE.RGB.name());
        lp.setProperty(LibProperties.HISTOGRAMS_BINS, "10");
        fd.setProperties(lp);
        System.err.println(fd.getDescription());
        BufferedImage image = ImageIO.read(new File("/home/mwh/kaggle/cifar10/train/97.png"));
        ColorProcessor cp = new ColorProcessor(image);
 fd.run(cp);
        double[] feats = fd.getFeatures().get(0);
        System.err.println(feats.length);
        System.err.println(Arrays.toString(feats));
    } 
}
